/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package autoverleih.server;

import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import soapclient.CCWebService;
import soapclient.ICurrencyConverterService;

/**
 *
 * @author Mike
 */
public class CurrencyClient {

	ICurrencyConverterService service;
	
    public void connect() throws MalformedURLException {
        URL url = new URL("http://192.168.243.9:9090/Service.svc?wsdl");
        CCWebService serviceWithUrl = new CCWebService(url, new QName("http://tempuri.org/", "CCWebService"));
        service = serviceWithUrl.getBasicHttpBindingICurrencyConverterService();
    }
    
    public CurrencyClient() {
	}
    
    public float calculate(String inCurrency, String outCurrency, float amount){
    	return service.calculate(inCurrency, outCurrency, amount);
    }

}
